package io.geekidea.boot.materials.service.Impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.geekidea.boot.materials.dto.MaterialsExcel;
import io.geekidea.boot.materials.entity.Materials;
import io.geekidea.boot.materials.mapper.MaterialsMapper;
import io.geekidea.boot.materials.query.MaterialsQuery;
import io.geekidea.boot.materials.service.MaterialsService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class MaterialsServiceImpl extends ServiceImpl<MaterialsMapper, Materials> implements MaterialsService {

    @Resource
    MaterialsMapper materialsMapper;

    @Override
    public Page<Materials> getMaterialsPageList(Page<Materials> page, MaterialsQuery materialsQuery) {
        return materialsMapper.getMaterialsPageList(page,materialsQuery);
    }
    @Override
    public int delById(Integer id) {
        return materialsMapper.delById(id);
    }

    @Override
    public List<Materials> getMaterialsList(Materials materials){
        return materialsMapper.getMaterialsList(materials);
    }

    @Override
    public int delByNumbers(String numbers) {
        return materialsMapper.delByNumbers(numbers);
    }
    @Override
    public List<MaterialsExcel> getDownloadList(MaterialsQuery materialsQuery){
        return materialsMapper.getDownloadList(materialsQuery);
    }

    @Override
    public Materials getMaterialsId(String id){
        return materialsMapper.getMaterialsId(id);
    }
}
